package cn.net.lwj.singledb.control;

import cn.net.lwj.common.model.JsonResult;
import cn.net.lwj.singledb.service.WsService;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WsControl {


    @Resource
    private WsService wsService;

    @RequestMapping("/wssc")
    public JsonResult wssc(String zipName ){

        try {
            return wsService.wsUpload(zipName);
        } catch (Exception e) {
            e.printStackTrace();
            return JsonResult.responseError(e.getMessage());
        }

    }

    @RequestMapping("/wsxz")
    public JsonResult wsxz(String xfbs, String zipName){
        try {
            return wsService.wsDownload(xfbs, zipName);
        } catch (Exception e) {
            e.printStackTrace();
            return JsonResult.responseError(e.getMessage());
        }
    }


}
